#coding:utf8
SNR = range(-10,31)

a = [0.357, 0.389, 0.408, 0.423, 0.441,
 0.469, 0.489, 0.509, 0.530, 0.555,
 0.585, 0.639, 0.660, 0.711, 0.741,
 0.764, 0.808, 0.840, 0.885, 0.899,
 0.928, 0.948, 0.966, 0.977, 0.987,
 0.990, 0.995, 0.996, 0.998, 0.998,
 1.0, 1.0, 1.0, 1.0, 1.0,
 1.0, 1.0, 1.0, 1.0, 1.0, 1]


b = [0.20, 0.209, 0.213, 0.225, 0.238,
0.26, 0.261, 0.277, 0.301, 0.317,
0.345, 0.37, 0.4, 0.42, 0.46,
0.504, 0.546, 0.595, 0.63, 0.69,
0.738, 0.788, 0.84, 0.88, 0.92,
0.94, 0.96, 0.97, 0.979, 0.988,
0.99, 0.99876510246312, 0.9957279220345772, 0.9980308390628129, 0.9990321073359589, 0.998998731726854, 1.0, 1.0, 1.0, 1.0, 1]

c = [0.1, 0.099, 0.11, 0.11, 0.12,
0.125, 0.132, 0.14, 0.155, 0.165,
0.175, 0.195, 0.206, 0.227, 0.246,
0.27, 0.295, 0.331, 0.355, 0.398,
0.43, 0.48, 0.52, 0.57, 0.60,
0.65, 0.7, 0.725, 0.75, 0.78,
0.85, 0.87, 0.898, 0.91, 0.93,
0.937, 0.946, 0.955, 0.953, 0.968, 0.973]


import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['simhei'] #用来正常显示中文标签

plt.rcParams['axes.unicode_minus']=False #用来正常显示负号

a = [0.95*(1-x) for x in a]
b = [0.95*(1-x) for x in b]
c = [0.95*(1-x) for x in c]

line_lrs, = plt.plot(SNR,a, 'rv-', label='QPSK')
line_mlp, = plt.plot(SNR,b, 'go-', label='8PSK')
line_16psk, = plt.plot(SNR,c, 'bs-', label='16PSK')
plt.legend([line_lrs,line_mlp, line_16psk],['QPSK', '8PSK', '16PSK'])
plt.xlabel(u"信噪比(dB)", fontsize=16)
plt.ylabel(u"误符号率", fontsize=16)
plt.ylim(0,1)
#plt.show()

plt.savefig('CP4DNN.png')
